package com.onlineauction.helpers;
import java.util.List;

import com.onlineauction.entities.*;
public class Utili {

	public static String getAverageRating(List<Review> reviews){
		String rating=null;
		double average =0;
		for(Review review: reviews){
			average += review.getRating();
		}
		
		average = average/reviews.size();
		rating = String.format("%1$.1f", average);
		return rating;
	}
	
	public static boolean isValidString(String s){
		if(s==null || s.isEmpty()){
			return false;
		}else{
			return true;
		}
	}

}
